const {getAbout,getCarousel,getNotice,getStaff} = require("../model");

///关于我们
module.exports.handleAbout=async (ctx,next)=>{
    let sqAbout=await getAbout()
    // console.log(sqAbout)
    if (sqAbout[0]){
        ctx.body = {
            status: 200,
            data:sqAbout,
            message: '获取成功'
        }
    }
}

//轮播图
module.exports.handleCarousel=async (ctx,next)=>{
    let sqCarousel=await getCarousel()
    // console.log(sqCarousel)
    if (sqCarousel[0]){
        ctx.body = {
            status: 200,
            data:sqCarousel,
            message: '获取成功'
        }
    }
}

//公告
module.exports.handleNotice=async (ctx,next)=>{
    let sqNotice=await getNotice()
    // console.log(sqCarousel)
    if (sqNotice[0]){
        ctx.body = {
            status: 200,
            data:sqNotice,
            message: '获取成功'
        }
    }
}

//员工
module.exports.handleStaff=async (ctx,next)=>{
    let sqStaff=await getStaff()
    // console.log(sqCarousel)
    if (sqStaff[0]){
        ctx.body = {
            status: 200,
            data:sqStaff,
            message: '获取成功'
        }
    }
}
